package my.mvc;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.know.entity.Users;

public class Test {
	public static void main(String[] args) {
		List<Users> testBeanList = new ArrayList<>();
		 Users testBean = new Users();
		 testBean.setUser_id(600L);
		 testBeanList.add(testBean);
	     
		 testBean = new Users();
		 testBean.setUser_id(700L);
		 testBeanList.add(testBean);
		 testBean = new Users();
		 testBean.setUser_id(450L);
		 testBeanList.add(testBean);
		 testBean = new Users();
		 testBean.setUser_id(980L);
		 testBeanList.add(testBean);
	     for(Users portService1:testBeanList){
	         System.out.println("---"+portService1.getUser_id());
	     }
	     ComparatorList comparatorList = new ComparatorList("user_id","Long");
	        Collections.sort(testBeanList,comparatorList);
	        Collections.reverse(testBeanList);
	        for(Users portService1:testBeanList){
	            System.out.println("***"+portService1.getUser_id());
	        }

	}
	 

}
